﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>

    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/common")

    @Scripts.Render("~/Scripts/jquery-1.10.2.min.js")
    @Scripts.Render("~/Scripts/layer/layer.js")

    <script type="text/javascript">

        function docking()
        {
            var loadLayerIndex = layer.load(0, {
                shade: [0.2, '#fff']
            });

            $.ajax({
                url: "/Api/Settings/GetPreAuthCode",
                type: "POST",
                dataType: "json",
                success: function (data, status, jqXHR)
                {
                    if (data.Success)
                    {
                        var url = String.format("https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={0}&pre_auth_code={1}&redirect_uri={2}",
                            data.Data.AppId, data.Data.PreAuthCode, "http://wxcm.shengxunwei.com/Settings/AuthorizationCallbackDemo");
                        window.location.href = url;

                    } else
                    {
                        layer.close(loadLayerIndex);
                        layerAlert(data.Message);
                    }
                },
                error: function (xmlHttpRequest)
                {
                    layer.close(loadLayerIndex);
                    alert("Error: " + xmlHttpRequest.status);
                }
            });
        }


    </script>

</head>
<body>
    <div id="divTopBar">
        <div id="divLogo">
            <span class="font_white_22">升讯威 微信营销系统</span>
        </div>
        <div id="divMainMenu">
            <table id="tableTopBar" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="td_MainMenu @if(ViewBag.MainMenu == "Portal"){@Html.Raw("td_MainMenu_active")}">
                        @Html.ActionLink("管理", "Member", "Member", null, new { @class = "a_white_18" })
                    </td>
                    <td class="td_MainMenu @if(ViewBag.MainMenu == "Campaign"){@Html.Raw("td_MainMenu_active")}">
                        @Html.ActionLink("活动", "Index", "Campaign", null, new { @class = "a_white_18" })
                    </td>
                    <td class="td_MainMenu @if(ViewBag.MainMenu == "Settings"){@Html.Raw("td_MainMenu_active")}">
                        @Html.ActionLink("设置", "Base", "Settings", null, new { @class = "a_white_18" })
                    </td>
                    <td class="td_MainMenu">&nbsp;</td>
                </tr>
            </table>
        </div>
        <div id="divTopRight">
            <table id="tableTopBar" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="td_MainMenu font_darkBlue_18">UserName</td>
                    <td class="td_MainMenu">@Html.ActionLink("退出", "Logout", "Home", null, new { @class = "a_white_18" })</td>
                </tr>
            </table>
        </div>
    </div>
    <div id="divContainer">
        <div id="divLeftMenu">
            <div id="divLeftTitle">
            </div>
            <div>
                @Html.Partial("_LeftMenu")
            </div>
        </div>
        <div id="divContentWrapper">
            <div id="divContent">
                <div id="divStartDocking">
                    <div style=" margin-top:20px; margin-left:10px; margin-right:10px; line-height:180%;" class="font_black_14">
                        注意：这是演示画面，可测试授权流程，但并无实际功能。<br />
                        请首先确保您的公众号是 <b>经过微信认证的服务号</b>，才能在对接后正常使用全部功能。<br>
                        如果还没有微信公众号，请前往微信公众平台(<a href="https://mp.weixin.qq.com/" target="_blank">mp.weixin.qq.com</a>)进行注册。
                    </div>

                    <div style="margin-top:20px; background-color:#F6F6F6; padding-top:25px; padding-bottom:25px;">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td height="120" align="center"><img src="/Content/Images/docking_ico1.gif" width="98" height="98"></td>
                                <td align="center"><img src="/Content/Images/docking_ico2.gif" width="98" height="98"></td>
                                <td align="center"><img src="/Content/Images/docking_ico3.gif" width="98" height="98"></td>
                            </tr>
                            <tr>
                                <td height="40" align="center" class="font_black_24">微信官方许可</td>
                                <td align="center" class="font_black_24">公众号免繁琐设置</td>
                                <td align="center" class="font_black_24">安全可靠</td>
                            </tr>
                            <tr>
                                <td height="30" align="center" class="font_gray_15">腾讯公司审核认证的可靠平台</td>
                                <td align="center" class="font_gray_15">一键对接，轻松快捷</td>
                                <td align="center" class="font_gray_15">本系统不会也无法获取您的密码</td>
                            </tr>
                        </table>
                    </div>

                    <div align="center" style="margin-top:30px;">
                        <img src="/Content/Images/docking_btn.jpg" width="367" height="62" onclick="docking()" style="cursor:pointer">
                    </div>

                </div>
            </div>
        </div>
        <div id="divContentMask" style="display:none">
        </div>
    </div>
</body>

</html>

